package com.ykht.proj.coupon.Enum;

public enum RuleTypeEnum {
	//1核销 2邀请 3转发 4关注 5收藏
	FEN_XIAO_TYPE_1(1,"核销"),
	FEN_XIAO_TYPE_2(2,"邀请"),
	FEN_XIAO_TYPE_3(3,"转发"),
	FEN_XIAO_TYPE_4(4,"关注"),
	FEN_XIAO_TYPE_5(5,"收藏");

	private Integer value;
	private String desc;

	private RuleTypeEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}


	/**
	 * 根据val值获取desc
	 * @param val 1、0
	 * @return
	 */
	public static String getDescByVal(Integer val) {
		RuleTypeEnum[] values = RuleTypeEnum.values();
		for (RuleTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe.getDesc();
			}
		}
		return null;
	}
	public static RuleTypeEnum getThisByVal(Integer val) {
		RuleTypeEnum[] values = RuleTypeEnum.values();
		for (RuleTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe;
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
